package org.gpp.proj1.robot.modifier;

import java.util.HashMap;
import java.util.Map;

public class ModifierFactory {
	private static ModifierFactory instance = null;
	
	private Map<String, Modifier> modifierMap;
		
	private ModifierFactory() {
		modifierMap = new HashMap<String, Modifier>();
	}

	public static ModifierFactory getInstance() {
		if( instance == null ) {
			instance = new ModifierFactory();
		}
		
		return instance;
	}
	
	public Modifier getModifier( String key ) {
		if( ! modifierMap.containsKey( key ) ) {
			loadModifier( key );
		}
		
		return modifierMap.get( key );
	}

	private void loadModifier( String key ) {
		//TODO implement me!
		modifierMap.put( key, new DummyModifier() );
	}
}
